package com.aaa.bbb.mymaintain.api;


import com.aaa.bbb.common.http.ResponseResult;
import com.aaa.bbb.mymaintain.entity.Employee;
import com.aaa.bbb.mymaintain.form.personForm;
import com.aaa.bbb.mymaintain.service.EmployeeSer;
import com.max.back.common.sercurity.anno.AuthIgrone;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author max
 * @since 2023-11-03
 */
@CrossOrigin
@RestController
@RequestMapping("/api/employee")
public class EmployeeCtl {
    @Autowired
    private EmployeeSer ser;

    @AuthIgrone
    @PostMapping("/getperson")
    public ResponseResult<List<Employee>> getPerson(@RequestBody @Valid personForm form) {
        List<Employee> list = ser.queryByCodeType(form.getPost());
        return ResponseResult.getSuccessResult(list);
    }

}

